Arm/atomic: correct asm() constraints in build_add_sized()
authorJan Beulich <jbeulich@suse.com>
Tue, 12 Mar 2019 13:42:17 +0000 (14:42 +0100)
committerStefano Stabellini <sstabellini@kernel.org>
Fri, 19 Apr 2019 21:02:03 +0000 (14:02 -0700)
The memory operand is an in/out one, and the auxiliary register gets
written to early.

Take the opportunity and also drop the redundant cast (the inline
functions' parameters are already of the casted-to type).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Julien Grall <julien.grall@arm.com>
(cherry picked from commit 51ceb1623b9956440f1b9943c67010a90d61f5c5)

xen/include/asm-arm/atomic.h

index 50f2835e355dc5760b22ea5be50e34cbdebb537b..afb3eeea5bcfae182c1149ebde3de415292a366a 100644 (file)
@@ -30,7 +30,7 @@ static inline void name(volatile type *addr, type val)                  \
     asm volatile("ldr" size " %"width"1,%0\n"                           \
                  "add %"width"1,%"width"1,%"width"2\n"                  \
                  "str" size " %"width"1,%0"                             \
-                 : "=m" (*(volatile type *)addr), "=r" (t)              \
+                 : "+m" (*addr), "=&r" (t)                              \
                  : reg (val));                                          \
 }